+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
+Fri Sep 7 18:50:59 2001 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkwidget.c (gtk_widget_get_default_colormap):
+ Make the default default colormap the GdkRGB colormap,
+ not the system colormap.
+
+ * gtk/gtkinvisible.c (gtk_invisible_init)
+ gtk/gtkwindow.c (gtk_window_init): Set the current
+ colormap, as returned by _gtk_widget_peek_colormap()
+ on the widget.
+
+ * gtk/gtkwidget.[ch]: Export _gtk_widget_peek_colormap
+ to GTK+. Make it return %NULL instead of the default
+ colormap if no colormap has explicitely been pushed.
+
+ * gtk/gtkwidget.c (gtk_widget_get_colormap): Check for
+ colormaps on ancestral widgets before defaulting the
+ the system default colormap.
+
+ * docs/Changes-2.0.txt: explain colormap changes.
+
2001-09-07 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c: add some lame code to handle G_MININT, fixes
gdk_wm_take_focus gdk_atom_intern ("WM_TAKE_FOCUS", FALSE)
gdk_wm_protocols gdk_atom_intern ("WM_PROTOCOLS", FALSE)
-
+* The handling of Colormaps and widgets has been changed:
+
+ - The default colormap for widgets is now the GdkRGB colormap, not
+ the system default colormap. If you try to use resources created for
+ a widget (e.g., widget->style) with a window using the system
+ colormap, errors will result on some machines.
+
+ - gtk_widget_push/pop_colormap() only cause the colormap to be
+ explicitely set on toplevel widgets not on all widgets. The
+ colormap for other widgets (when not set using
+ gtk_widget_set_colormap()), is determined by finding the nearest
+ ancestor with a colormap set on it explicitely, or if that
+ fails, the default colormap.
+
+
\ No newline at end of file
static void
gtk_invisible_init (GtkInvisible *invisible)
{
+ GdkColormap *colormap;
+
GTK_WIDGET_UNSET_FLAGS (invisible, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (invisible, GTK_TOPLEVEL);
gtk_object_sink (GTK_OBJECT (invisible));
invisible->has_user_ref_count = TRUE;
+
+ colormap = _gtk_widget_peek_colormap ();
+ if (colormap)
+ gtk_widget_set_colormap (GTK_WIDGET (invisible), colormap);
}
static void
GdkEventFocus *event);
static gboolean gtk_widget_real_focus (GtkWidget *widget,
GtkDirectionType direction);
-static GdkColormap* gtk_widget_peek_colormap (void);
static PangoContext* gtk_widget_peek_pango_context (GtkWidget *widget);
static void gtk_widget_reparent_container_child (GtkWidget *widget,
gpointer client_data);
widget->style = gtk_widget_get_default_style ();
gtk_style_ref (widget->style);
-
- colormap = gtk_widget_peek_colormap ();
-
- if (colormap != gtk_widget_get_default_colormap ())
- gtk_widget_set_colormap (widget, colormap);
}
if (colormap)
return colormap;
}
-
- colormap = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_colormap);
- if (colormap)
- return colormap;
+
+ while (widget)
+ {
+ colormap = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_colormap);
+ if (colormap)
+ return colormap;
+
+ widget = widget->parent;
+ }
return gtk_widget_get_default_colormap ();
}
void
gtk_widget_pop_colormap (void)
{
- GSList *tmp;
-
if (colormap_stack)
- {
- tmp = colormap_stack;
- colormap_stack = colormap_stack->next;
- g_slist_free_1 (tmp);
- }
+ colormap_stack = g_slist_delete_link (colormap_stack, colormap_stack);
}
/**
gtk_widget_get_default_colormap (void)
{
if (!default_colormap)
- gtk_widget_set_default_colormap (gdk_colormap_get_system ());
+ gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
return default_colormap;
}
requisition->height = widget->requisition.height;
}
-/*****************************************
- * gtk_widget_peek_colormap:
- *
- * arguments:
- *
- * results:
- *****************************************/
-
-static GdkColormap*
-gtk_widget_peek_colormap (void)
+/**
+ * _gtk_widget_peek_colormap:
+ *
+ * Returns colormap currently pushed by gtk_widget_push_colormap, if any.
+ *
+ * Return value: the currently pushed colormap, or %NULL if there is none.
+ **/
+GdkColormap*
+_gtk_widget_peek_colormap (void)
{
if (colormap_stack)
return (GdkColormap*) colormap_stack->data;
- return gtk_widget_get_default_colormap ();
}
static void
void _gtk_widget_propagate_hierarchy_changed (GtkWidget *widget,
GtkWidget *previous_toplevel);
+GdkColormap* _gtk_widget_peek_colormap (void);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
static void
gtk_window_init (GtkWindow *window)
{
+ GdkColormap *colormap;
+
GTK_WIDGET_UNSET_FLAGS (window, GTK_NO_WINDOW);
GTK_WIDGET_SET_FLAGS (window, GTK_TOPLEVEL);
window->decorated = TRUE;
window->mnemonic_modifier = GDK_MOD1_MASK;
+ colormap = _gtk_widget_peek_colormap ();
+ if (colormap)
+ gtk_widget_set_colormap (GTK_WIDGET (window), colormap);
+
gtk_widget_ref (GTK_WIDGET (window));
gtk_object_sink (GTK_OBJECT (window));
window->has_user_ref_count = TRUE;